<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use App\Jobs\testJob;
use Illuminate\Http\Request;
use App\Agent;


/**
 * @resource Api总类
 *
 * Longer description
 */
class ApiController extends Controller {

	public function checkLogin(Request $request){
		$results = DB::table('sys_config')->where('variable', 'diagnostics.allow_i_s_tables')->first();
		//$agent=Agent::with('sys_config')->select();
		var_dump($results);
		//var_dump($request->input('checkLogin'));
	}



	/**
	 * @param $request
	 * @return array
	 * 测试文档主页
	 */
	public function index(Request $request){
		//var_dump($request);exit;
		//return 'view';exit;
//		dd($request->input('link'));
////		echo '<a href="'.route('api.index',['id'=>4]).'">撒地方司法 </a>';
//		return [
//			'info'	=> '信息',
//			'data'	=> [
//				'data1'	=> 1,
//				'data2'	=> 2,
//			]
//		];
	}
	
	/**
	 * @api {get} api/index2 测试2
	 * @apiDescription 说明2，重要，，，，
	 * @apiParamExample {json} 返回示例
	 * {status:1,info:"成功",data:{"id":1}}
	 */
	public function index2(){
		$this->dispatch(new testJob());
//		\Mail::to('yybawang@163.com')->queue(new \App\Mail\TestQueue());
		$data = str_limit('怎么说呢', 5);
		return $data;
	}
}